home *** CD-ROM | disk | FTP | other *** search
/ Loadstar 12 / 012.d81 / house inventory (.txt) < prev    next >
Commodore BASIC  |  2022-08-26  |  13KB  |  388 lines

  1. 1 gosub60000
  2. 10 fordi=49152to49415:readda:pokedi,da:next
  3. 20 me=0
  4. 30 print"[147]":f=53280:pokef,0:pokef+1,0
  5. 40 rem        poke808,234
  6. 50 poke53265,11:printchr$(142)
  7. 60 close1:close2:close15:print"[147][159]                                        ";
  8. 70 pokef,4:pokef+1,6:ifpeek(788)=76thensys820
  9. 80 print"***** household inventory program ******";
  10. 90 print"         **** version 3.2 ****          [154]"
  11. 100 rem r.w. kober wrote this program
  12. 110 rem version 3.2  march 24,1985
  13. 120 printtab(15)"[145][159]        [146]"
  14. 130 printtab(15)"[159] *menu* [146]                "
  15. 140 printtab(15)"[159]        [146]                "
  16. 150 print"      [159]1[146][150] = read file data on screen."
  17. 160 print"      [159]2[146][150] = create a new file."
  18. 170 print"      [159]3[146][150] = edit or insert into a file."
  19. 180 print"      [159]4[146][150] = print file data to printer."
  20. 190 print"      [159]5[146][150] = list file directory."
  21. 200 print"      [159]6[146][150] = help (information)."
  22. 210 print"      [159]7[146][150] = scratch a file."
  23. 220 print"      [159]e[146][150] = exit inventory program."
  24. 230 print"[158]   '\' returns to menu at any prompt    [146][154]":h=0:ds=0
  25. 240 ifme<1thenprinttab(26)"[155]by bob kober"
  26. 250 ifme<1thenprinttab(27)"apr 1,1985[154]":gosub2760
  27. 260 ifme<1thenformu=820to907:readno:pokemu,no:next:me=1:print"[145][145][145][159]":goto130
  28. 270 gosub1720:poke19,0:ifr$="e"then2800
  29. 280 ifr$="\"then60
  30. 290 ifr$="^"thenr$="5"
  31. 300 poke54296,0:r=val(r$):ifr<1orr>7then270
  32. 310 ifr>0andr<5thenclose15:open15,8,15
  33. 320 z=r:onrgoto460,330,460,460,2590,1780,2910
  34. 330 pokef,2:pokef+1,2:gosub1580
  35. 340 print:print"  [158] warning!!! [146] any existing file with "
  36. 350 print"  this name will be replaced!![154]"
  37. 360 print"[145][145][145][145][145][145][145][145][145]"
  38. 370 print:print"[144]  enter new filename ";
  39. 380 gosub2600:ifk$="^"thensys49152:goto330
  40. 390 po=1
  41. 400 ifkf=2then330
  42. 410 ifkf=1thenprint"[145][145]":goto370
  43. 420 close2:open2,8,5,"@0:"+f$+",s,w":gosub2150
  44. 430 ifz=3thenprint"[147]":goto880
  45. 440 gosub1210:ifcthengosub1460:goto440
  46. 450 goto810
  47. 460 ifz=1thenpokef,11:pokef+1,11
  48. 470 ifz=3thenpokef,6:pokef+1,6
  49. 480 ifz=4thenpokef,9:pokef+1,9
  50. 490 gosub1580
  51. 500 print:print"[158]  enter filename ";
  52. 510 ifz=1thenprint:print"  (wild cards may be used)"
  53. 520 ifz=3thenprint:print" [158] warning! [146] [159]the existing file with"
  54. 530 ifz=3thenprint" this name will be edited!!![145][145][158]"
  55. 540 ifz=1orz=3thenprinttab(18)"[145][145][145][145]";
  56. 550 gosub2600:ifk$="^"thensys49152:goto460
  57. 560 ifkf=2then460
  58. 570 ifkf=1thenprint"[145][145]":goto500
  59. 580 close1:open1,8,6,"0:"+f$+",s,r":gosub2150
  60. 590 x$=""
  61. 600 ifz=4then2190
  62. 610 ifz=2then340
  63. 620 ifz=3then420
  64. 630 gosub3120:ifms=1thenms=0:goto60
  65. 640 ifms=2thengosub1750:ifr$="\"then60
  66. 650 ifms=2then580
  67. 660 gosub1490:ifc>1then750
  68. 670 gosub1420:ifcthen760
  69. 680 gosub1490:ifc>1then760
  70. 690 gosub1430:ifcthen760
  71. 700 gosub1490:ifc>1then760
  72. 710 gosub1430:ifcthen760
  73. 720 gosub1650
  74. 730 gosub1750:ifr$<>"\"then660
  75. 740 goto810
  76. 750 print"[147] end of mode #1 [146]  done reading data file":print
  77. 760 gosub1650
  78. 770 ifc=1thenprinttab(11)"[159] end of data file! [146][154]":goto800
  79. 780 ifc>1andst<>64thenprint"disk error ( status = ";st;")"
  80. 790 printtab(11)"[159] end of data file! [146][154]"
  81. 800 gosub1710
  82. 810 close1:close2:close15:i9$="":ifr$="^"thensys49152
  83. 820 goto60
  84. 830 gosub1490:ifc>1then1120
  85. 840 ifz=3andleft$(i$,len(i9$))=i9$thengosub1580:goto890
  86. 850 print" now copying : [158]"i$"                     [145][145][154]"
  87. 860 gosub1460:ifc=1then1120
  88. 870 ifi9$<>""then830
  89. 880 gosub1490:ifc>1then1120
  90. 890 gosub1580:gosub1430:gosub1650:print"[145] [158]desired action: (enter by number)"
  91. 900 print"  [150]1[154][146] = copy this item with no changes."
  92. 910 print"  [150]2[154][146] = [150] delete [146][154] this item."
  93. 920 print"  [150]3[154][146] = insert items before this one."
  94. 930 print"  [150]4[154][146] = search until item is found."
  95. 940 print"  [150]\[154][146] = return to the main menu."
  96. 950 print" [158]action ? ";:poke204,0
  97. 960 gosub1720:ifr$="\"thenprint"[158]ok-please wait while all items are re-copied[154]"
  98. 970 ifr$="\"theni9$="qzqzqzqz":goto840
  99. 980 r=val(r$):ifr<1orr>4then960
  100. 990 printtab(10)" ";r$;" [146][154]":print"            [145][158]  okay  [146][154]":ford=1to500:next
  101. 1000 i9$="":on r goto860,1010,1030,1060,810
  102. 1010 ifc=1then1120
  103. 1020 goto880
  104. 1030 i9$=i$:w9$=w$:m9$=m$:s9$=s$:d9$=d$:v9$=v$:c9=cc
  105. 1040 gosub1210:ifcthengosub1460:goto1040
  106. 1050 i$=i9$:w$=w9$:m$=m9$:s$=s9$:d$=d9$:v$=v9$:c=c9:goto890
  107. 1060 gosub1580:print" all entries will be copied until"
  108. 1070 print:print" desired item is found;"
  109. 1080 print:print:print" enter item to search for:"
  110. 1090 input"   [158]end[157][157][157][157][157][154]";i9$
  111. 1100 ifleft$(i9$,1)="\"thenr$="\":print"search aborted! please wait":goto970
  112. 1110 print" wait!!  searching for ";i9$:goto840
  113. 1120 ifi9$="qzqzqzqz"thenh=1:goto1140
  114. 1130 k=0
  115. 1140 gosub1580:ifc>1then780
  116. 1150 ifh<>1thenprint"[150]  end of input file!"
  117. 1160 ifh<>1thenprint:print"  do you want to add any entries to the"
  118. 1170 ifh<>1thenprint:print"  end of this data file?";
  119. 1180 gosub1660:ifr$="n"thenprinttab(5)" [158] okay [146][154] returning to menu":goto810
  120. 1190 gosub1210:ifcthengosub1460:goto1190
  121. 1200 goto810
  122. 1210 c=0:print"[147][144]        enter item information":print" d = done entering data"
  123. 1220 print" e = error, restart entire item"
  124. 1230 print:print" do not use ',' or ':' within the data"
  125. 1240 print:print" press return[146] after each entry"
  126. 1250 gosub1650:input"[144] item [146]   ?[157][157][157]";i$:ifi$="e"then1210
  127. 1260 ifi$="d"then1400
  128. 1270 input " make [146]   ?[157][157][157]";w$:if w$="e"then1210
  129. 1280 ifw$="d"then1400
  130. 1290 input" model [146]   ?[157][157][157]";m$:if m$="e"then1210
  131. 1300 ifm$="d"then1400
  132. 1310 input" serial #/id [146]   ?[157][157][157]";s$:ifs$="e"then1210
  133. 1320 ifs$="d"then1400
  134. 1330 input" date acq'd [146] (month/day/year)   ?[157][157][157]";d$:if d$="e"then1210
  135. 1340 d$=left$(d$,8):ifd$="d"then1400
  136. 1350 input" $ value [146]   ?[157][157][157]";v$:ifv$="e"then1210
  137. 1360 ifv$="d"then1400
  138. 1370 gosub1420:gosub1650
  139. 1380 print"[158] is this entry correct?";:gosub1660:ifr$="n"then1210
  140. 1390 c=1:po=0:return
  141. 1400 printtab(7)"[150]returning to the menu-----":ifpo=0thenreturn
  142. 1410 close15:open15,8,15:print#15,"s:"f$:return
  143. 1420 print"[147]";
  144. 1430 print"[153] item:[146] ";i$:print" make:[146] ";w$:print" model[146] ";m$
  145. 1440 print" serial #/id:[146] ";s$
  146. 1450 print" date acq'd:[146] "d$;tab(22);" value:[146] $";v$;"[154]":print:return
  147. 1460 x$=i$:gosub1480:x$=w$:gosub1480:x$=m$:gosub1480
  148. 1470 x$=s$:gosub1480:x$=d$:gosub1480:x$=v$
  149. 1480 print#2,x$;chr$(13);:goto2150
  150. 1490 gosub1560:i$=x$:ifcthenreturn
  151. 1500 gosub1560:w$=x$:ifcthenreturn
  152. 1510 gosub1560:m$=x$:ifcthenreturn
  153. 1520 gosub1560:s$=x$:ifcthenreturn
  154. 1530 gosub1560:d$=x$:ifcthenreturn
  155. 1540 gosub1560:v$=x$:ifc=2thenc=1
  156. 1550 return
  157. 1560 c=0:input#1,x$:ifstthenc=3:ifst=64thenc=2
  158. 1570 goto2150
  159. 1580 ifz=1thenprint"[147]   mode #1 [146]  read file data on screen":ifds=1then1650
  160. 1590 ifz=2thenprint"[147][158]      mode #2 [146]  create a new file"
  161. 1600 ifz=3thenprint"[147][159]    mode #3 [146]  edit (or append) a file"
  162. 1610 ifz=4thenprint"[147]   mode #4 [146] print data file to printer"
  163. 1620 print
  164. 1630 ifz<5thenprint"    enter '\' to return to the menu"
  165. 1640 ifz<5andz<>3thenprint"    enter '^' to list the file directory"
  166. 1650 print"---------------------------------------[154]":print:return
  167. 1660 ifh<>1thenprint" (y/n) ? ";
  168. 1670 gosub1720:ifr$<>"y"andr$<>"n"andr$<>"\"then1670
  169. 1680 ifh<>1thenprintr$
  170. 1690 ifr$="\"thenr$="n"
  171. 1700 return
  172. 1710 print:print"[150]   hit any key when ready to continue   [146][154]";:goto1760
  173. 1720 getr$:ifi9$="qzqzqzqz"thenr$="n"
  174. 1730 ifr$=""then1720
  175. 1740 poke204,1:return
  176. 1750 print:print"   [150] hit any key to continue, \=menu [146][154]";
  177. 1760 gosub1720:ifz=6thenreturn
  178. 1770 print:printtab(15)"[158] okay [146][154]":ford=1to100:next:print"[147]":return
  179. 1780 pokef,11:pokef+1,11:print""
  180. 1790 print"[147][146]this program is designed to write, read,";
  181. 1800 print"print, edit, or append disk data files "
  182. 1810 print"containing information on your household";
  183. 1820 prin